package com.neusoft.feign;
import com.neusoft.po.Cart;
import com.neusoft.po.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.List;

//指定调用的微服务名
@FeignClient(name="credit-server",fallback=CreditFeignClientCallBack.class)
public interface CreditFeignClient {
    /*@RequestMapping("/listCart")
    public CommonResult<List> listCart(Cart cart);

    @RequestMapping("/clearCart")
    public CommonResult<Integer> clearCart(Cart cart);
    @PutMapping("/PayoutByUserId/{userId}/{sub_number}")
    */


    @PutMapping("/Credit/PayoutByUserId/{userId}/{sub_number}")
    public CommonResult<Integer> payoutByUserId(@PathVariable("userId")String userId, @PathVariable("sub_number") Integer sub_number) ;

    @GetMapping("/Credit/TotalCredit/{userId}")
    public CommonResult<Integer> getTotalCreditByUserId(@PathVariable("userId") String userId) throws Exception;
    @PutMapping("/Credit/RechargeByUserId/{userId}/{add_number}")
    public CommonResult<Integer> rechargeByUserId(@PathVariable("userId")String userId,@PathVariable("add_number")Integer add_number);
}